public class Memory implements Comparable<Memory>
{
	private int id;
	private int size;
	private int address;

	public Memory(int totalSize)
	{
		size = totalSize;
		address = 0;
		id = -1;
	}

	public Memory(int size, int start, int ID)
	{
		this.size = size;
		address = start;
		id = ID;
	}

	public int id()
	{
		return id;
	}

	public void setId(int newId)
	{
		this.id = newId;
	}

	public int size()
	{
		return size;
	}

	public void setSize(int newSize)
	{
		this.size = newSize;
	}

	public int address()
	{
		return address;
	}

	public void setAddress(int newAddress)
	{
		this.address = newAddress;
	}

	public int compareTo(Memory other)
	{
		int compare = this.size - other.size;
		if (compare == 0)
			return this.address - other.address;
		else return compare;
	}

	public String toString()
	{
		return "size: " + size + ", address: " + address + ", ID: " + id;
	}	
}